package com.tang.controller;

import com.tang.entity.Activity;
import com.tang.entity.Stock;
import com.tang.factory.ActivityFactory;
import com.tang.util.RedisUtils;

/**
 * 活动商品Controller
 *
 * @author fulin.tang
 * @version V3.0
 * @since 2021/9/13 18:14
 */
public class ActivityController {
    
    private final RedisUtils redisUtils = new RedisUtils();
    
    public Activity queryActivityInfo(Long id) {
        Activity activity = ActivityFactory.getActivity(id);
        Stock stock = new Stock(1000, redisUtils.getStockUsed());
        activity.setStock(stock);
        return activity;
    }
    
}
